// 注册全局组件

import Skeleton from './Skeleton'
import Slider from './Slider'
import More from './More'
import Bread from './Bread'
import BreadItem from './Bread/item.vue'
import City from './City'
import Sku from './Sku'
import NumBox from './Numbox'
import Button from './Button'
import CheckBox from './CheckBox'

// 方法一
// export default {
//   install (app) {
// vue2：参数是Vue构造函数 vue3：app 根实例
//     app.component(Skeleton.name, Skeleton)
//     app.component(XtxSlider.name, XtxSlider)
//   }
// }

// 方法二
// 1.准备放置组件数据
const components = [
  Skeleton,
  Slider,
  More,
  Bread,
  BreadItem,
  City,
  Sku,
  NumBox,
  Button,
  CheckBox
]

// 2.注册导出
// vue2:参数是Vue构造函数  vue3:参数是app 根实例
export default {
  install (app) {
    components.forEach(component => {
      app.component(component.name, component)
    })
  }
}
